import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'main',
    component: () => import('../views/Main.vue'),
    children: [
      {
        path: 'home',
        alias: '',
        name: 'Home',
        component: () => import('../views/Home.vue')
      },
      {
        path: 'discover',
        name: 'Discover',
        component: () => import('../views/Discover.vue')
      },
      {
        path: 'my',
        name: 'My',
        component: () => import('../views/My.vue')
      }
    ]
  },
  {
    path:'/audio/:trackid',
    name:'Audio',
    component: () => import('../views/Audio.vue')
  },
  {
    path:'/paihangbang',
    name:'Paihangbang',
    component: () => import('../views/Paihangbang.vue')
  },
  {
    path:'/tingdan',
    name:'Tingdan',
    component: () => import('../views/Tingdan.vue')
  },
  {
    path:'/tomatoes/:link/:name1',
    name:'Tomatoes',
    component: () => import('../views/Tomatoes.vue')
  },
  {
    path:'/account',
    name:'Account',
    component: () => import('../views/Account.vue')
  },
  {
    path:'/myMessage',
    name:'MyMessage',
    component: () => import('../views/MyMessage.vue')
  },
  {
    path:'/function',
    name:'Function',
    component: () => import('../views/Function.vue')
  },
  {
    path:'/privacy',
    name:'Privacy',
    component: () => import('../views/Privacy.vue')
  },
  {
    path:'/inregardto',
    name:'inRegardTo',
    component: () => import('../views/inRegardTo.vue')
  },
  {
    path:'/login',
    name:'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path:'/search',
    name:'Search',
    component: () => import('../views/Search.vue')
  }
]

const router = new VueRouter({
  mode: 'hash',
  routes
})

export default router
